package com.wtwd.campus.vcom.dao;

import com.wtwd.campus.entity.PolygonFence;
import com.wtwd.campus.vcom.entity.VcomCircleFence;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * @Author: ldaoliang
 * @DateTime: 2022/1/7 10:53
 * @Description:
 */
@Mapper
public interface VcomFenceMapper {

    /**
     * 根据fenceId获取威科姆围栏数据
     * @param fenceId
     * @return
     */
    VcomCircleFence getVcomFenceByFenceId(String fenceId);

    /**
     * 更新威科姆围栏
     * @param vcomCircleFence
     * @return
     */
    int updateVcomFence(VcomCircleFence vcomCircleFence);

    /**
     * 添加威科姆围栏
     * @param vcomCircleFence
     * @return
     */
    int addVcomFence(VcomCircleFence vcomCircleFence);

    /**
     * 删除围栏关联的设备
     * @param fenceId
     * @return
     */
    int delFenceImei(String fenceId);

    /**
     *
     * @param fenceId
     * @param imeis
     * @return
     */
    int addFenceImei(@Param("fenceId") String fenceId, @Param("list") List<String> imeis);

    /**
     * 删除围栏
     * @param fenceId
     * @return
     */
    int delFence(@Param("fenceId")String fenceId);

    /**
     * 增量删除围栏关联的imei
     * @param fenceId
     * @param list
     * @return
     */
    int incrementDelFenceImei(@Param("fenceId") String fenceId, @Param("list") List<String> list);

    /**
     * 根据fenceId
     * @param fenceId
     * @return
     */
    List<String> getImeiListByFenceId(@Param("fenceId") String fenceId);

    /**
     * 获取设备的围栏列表
     * @param imei
     * @return
     */
    List<VcomCircleFence> getVcomActiveFenceByImei(@Param("imei") String imei);

    VcomCircleFence getVcomFenceInfoByFenceId(@Param("fenceId") String fenceId);

    List<PolygonFence> getPolygonFenceByImei(@Param("imei") String imei,@Param("active") Integer active);
}
